package com.graduate.emos.wx.service;

import com.graduate.emos.wx.db.pojo.MessageEntity;
import com.graduate.emos.wx.db.pojo.MessageRefEntity;

import java.util.HashMap;
import java.util.List;

/*消息业务接口*/
public interface MessageService {

    /*插入新Message数据*/
    public String insertMessage(MessageEntity message);

    /*根据分页查询Message数据*/
    public List<HashMap> searchMessageByPage(int userId, long start, int length);

    /*根据id查询消息*/
    public HashMap searchMessageById(String id);

    /*新增MessageRef数据*/
    public String insertMessageRef(MessageRefEntity messageRef);

    /*查询未读消息的数量*/
    public long searchUnreadCount(int userId);

    /*查询最新消息数量*/
    public long searchLastCount(int userId);

    /*修改消息状态*/
    public long updateUnreadMessage(String id);

    /*根据id删除消息记录*/
    public long deleteMessageRefById(String id);

    /*根据userId删除用户所有的消息*/
    public long deleteUserMessageRef(int userId);
}